﻿<Common:LayoutAwarePage
	x:Class="Coding4Fun.Toolkit.Test.WindowsStore.Samples.Buttons.OpacityToggleButtons"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Common="using:Coding4Fun.Toolkit.Test.WindowsStore.Common"
    xmlns:c4f="using:Coding4Fun.Toolkit.Controls">
	<Common:LayoutAwarePage.Resources>
		<Style x:Key="GridViewItemStyle1" TargetType="GridViewItem">
			<Setter Property="Background" Value="Transparent"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="GridViewItem">
						<ContentPresenter 
							ContentTransitions="{TemplateBinding ContentTransitions}" 
							HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
							Margin="{TemplateBinding Padding}"
							VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>

	</Common:LayoutAwarePage.Resources>

	<Grid Style="{StaticResource LayoutRootStyle}">
		
        <Grid.RowDefinitions>
            <RowDefinition Height="140"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

		<Common:BaseHeader Title="Opacity Toggle Buttons" />

		<GridView
            AutomationProperties.AutomationId="ItemsGridView"
            AutomationProperties.Name="Items"
			ItemContainerStyle="{StaticResource GridViewItemStyle1}"
            TabIndex="1"
            Grid.Row="1"
            Padding="116, 0"
            SelectionMode="None"
            IsSwipeEnabled="false">
			<StackPanel>
				<StackPanel Orientation="Horizontal">
					<c4f:OpacityToggleButton />
					<c4f:OpacityToggleButton
						Background="Red"
						UncheckedOpacity=".5"
						CheckedOpacity="1"
						IsChecked="true">
						<c4f:OpacityToggleButton.Label>
							Checked
						</c4f:OpacityToggleButton.Label>
					</c4f:OpacityToggleButton>
					<c4f:OpacityToggleButton 
						IsChecked="true"
						Label="Checked" />

					<c4f:OpacityToggleButton
						Background="Red"
						IsEnabled="False"
						Label="disabled"/>
					<c4f:OpacityToggleButton
						Background="Red"
						IsEnabled="False"
						IsChecked="True"
						Label="dis + chk"/>
				</StackPanel>
				<StackPanel Orientation="Horizontal">
					<c4f:OpacityToggleButton
						Orientation="Horizontal"
						Label="hor" />
					<c4f:OpacityToggleButton
							Orientation="Horizontal"
							IsChecked="true"
							Label="hor/chk"/>
					<c4f:OpacityToggleButton
						Background="CornflowerBlue"
						Foreground="lime"
						UncheckedOpacity=".9"
						CheckedOpacity=".4"
						Padding="12" 
						Label="opa + pad" />

				</StackPanel>
				<StackPanel Name="DisableViewStateTest">
					<TextBlock>Disable Test</TextBlock>
					<StackPanel Orientation="Horizontal">
						<c4f:OpacityToggleButton 
							IsChecked="true"
							Label="Checked" />
						<c4f:OpacityToggleButton />
						<c4f:OpacityToggleButton 
							Background="Gold" 
							IsChecked="true"
							Label="Checked" />
						<c4f:OpacityToggleButton 
							Background="Gold"/>
					</StackPanel>
					<StackPanel Orientation="Horizontal">
						<c4f:OpacityToggleButton
							Orientation="Horizontal"
							Label="hor"/>
						<c4f:OpacityToggleButton
							Orientation="Horizontal"
							IsChecked="true"
							Label="hor/chk"/>
					</StackPanel>
					<StackPanel Orientation="Horizontal">
						<ToggleButton 
							IsChecked="true">
							Checked
						</ToggleButton>
						<ToggleButton />
						<ToggleButton 
							Background="Gold" 
							IsChecked="true">
							Checked
						</ToggleButton>
						<ToggleButton Background="Gold"/>
					</StackPanel>
				</StackPanel>
				<CheckBox 
					x:Name="ToggleCheck"
					HorizontalAlignment="Right"
					IsChecked="true" 
					Unchecked="ToggleChecked"
					Checked="ToggleChecked" >
					Is Enabled
				</CheckBox>
			</StackPanel>
			<Button 
					Content="Toggle background" 
					VerticalAlignment="Bottom"
					HorizontalAlignment="Right" 
					Click="ToggleBackgroundClick" />
		</GridView>
	</Grid>
</Common:LayoutAwarePage>